package jtk.project4.fleet.field;

import java.awt.FlowLayout;

import jtk.project4.fleet.action.AddEmployeeAction;
import jtk.project4.fleet.action.AddEquipmentAction;
import jtk.project4.fleet.action.AddInventoryAction;
import jtk.project4.fleet.action.AddPartInventoryAction;
import jtk.project4.fleet.action.GeneralTankInformationAction;
import jtk.project4.fleet.action.LastPmSetUpAction;

import nl.coderight.jazz.action.Action;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.ComboField;
import nl.coderight.jazz.form.field.SpinnerField;
import nl.coderight.jazz.form.field.TableField;
import nl.coderight.jazz.form.field.TextField;
import nl.coderight.jazz.form.field.TableField.AutoResizeMode;
import nl.coderight.jazz.form.field.button.CheckButton;
import nl.coderight.jazz.form.field.button.PushButton;
import nl.coderight.jazz.form.field.button.RadioButton;

public class InventoryPartListingField extends GroupControl {
//deklarasi var
private TableField inventoryTableField;
private ComboField inventoryComboField;

private Action addPartInventoryAction;

//private RadioButton inventoryRadioButton;
private CheckButton inventoryShowRowCheckButton;
private PushButton addPartInventoryListingPushButton;
private PushButton editPartInventoryListingPushButton;
private PushButton deletePartInventoryListingPushButton;
private PushButton printPartInventoryListingPushButton;
private PushButton filterPartInventoryListingPushButton;


public InventoryPartListingField(String bindID){
	//setTitle("header.identification");
	createActions();
	setBindID(bindID);
	createFields();
	createLayout();
}
private void createFields(){
	//GroupControl buttons = new GroupControl;
	//inventoryComboField.setPreferredSize(inventoryComboField.getPreferredSize());
	inventoryComboField = new ComboField("All Location","All Locations");
	inventoryTableField = new TableField("",""); 
		inventoryTableField.setAutoResizeMode(AutoResizeMode.OFF);
		
		inventoryTableField.addColumn("label.Part","");
		inventoryTableField.addColumn("label.Name","");
		inventoryTableField.addColumn("label.Description","");
		inventoryTableField.addColumn("label.Manufacturer","");
		inventoryTableField.addColumn("label.Category","");
		inventoryTableField.addColumn("label.Unit Cost","");
		inventoryTableField.addColumn("label.Unit of Meas.","");
		inventoryTableField.addColumn("label.Quantity","");
		inventoryTableField.addColumn("label.Extended Cost","");
		inventoryTableField.addColumn("label.PO #","");
		inventoryTableField.addColumn("label.Markup","");
		inventoryTableField.addColumn("label.Warranty","");
		inventoryTableField.addColumn("label.Custom Field #2","");
		inventoryTableField.addColumn("label.UPC (barcode)","");
		inventoryTableField.addColumn("label.Location","");
		inventoryTableField.addColumn("label.Aisle","");
		inventoryTableField.addColumn("label.Row","");
		inventoryTableField.addColumn("label.Bin","");
		inventoryTableField.addColumn("label.Inventory Enabled","");
		inventoryTableField.addColumn("label.Reorder Point","");
		inventoryTableField.addColumn("label.Reorder Quantity","");
		inventoryTableField.addColumn("label.Lead Time","");
		
	
		
//-------group buttons 2----------- pemasukan roh kedalam variabel wkwkwkwk
		//inventorySpinnerField = new SpinnerField("a","a");
		addPartInventoryListingPushButton = new PushButton(addPartInventoryAction);
		editPartInventoryListingPushButton = new PushButton("Edit");
		deletePartInventoryListingPushButton = new PushButton("Delete");
		printPartInventoryListingPushButton= new PushButton("Print");
		filterPartInventoryListingPushButton= new PushButton("Filter");
		inventoryShowRowCheckButton = new CheckButton("Show Row Filter");
}

private GroupControl createButtonsFields2() {
	GroupControl buttons = new GroupControl();
	buttons.setLayout(new FlowLayout(FlowLayout.CENTER));
	
	buttons.addField(addPartInventoryListingPushButton);
	buttons.addField(editPartInventoryListingPushButton);
	buttons.addField(deletePartInventoryListingPushButton);
	buttons.addField(printPartInventoryListingPushButton);
	buttons.addField(filterPartInventoryListingPushButton);
	buttons.addField(inventoryShowRowCheckButton);
	return buttons;
}

private GroupControl createButtonsField3(){
	GroupControl b = new GroupControl();
	b.setLayout(new FlowLayout(FlowLayout.LEFT));
	
	b.addField(inventoryComboField);
	//b.addField(inventoryTableField);
	//buttons.addField();
	return b;
}

private GroupControl createButtonsField1(){
	GroupControl b = new GroupControl();
	b.setLayout(new FlowLayout(FlowLayout.LEFT));
	b.addField(inventoryTableField);
	return b;
}
/*
private GroupControl radButtons(){
	GroupControl rad = new GroupControl();
	rad.setLayout(new FlowLayout(FlowLayout.LEFT));
	//setHeader("Header");
	rad.addField(inventoryRadioButton);
	return rad;
}*/

private void createLayout() {
	setLayout(new FormLayout())
	//.addLabel("warehouse :") 
	.addField(inventoryComboField)
	.addRow()
	.addField(inventoryTableField)
	.addRow()
	.addField(createButtonsFields2())
	.addRow()
	//.addField(radButtons())
	;
}

private void createActions(){
	addPartInventoryAction = new AddPartInventoryAction();
	
	//**********************************
}
}
